using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Nicknames.Info;
using NicksLogic = Nicknames.BusinessLogic;

public partial class DataFeeder : System.Web.UI.Page
{
    #region " Properties "

    NicksRequestInfo requestInfo;

    #endregion properties

    protected void Page_Load(object sender, EventArgs e)
    {
        //Just for sample

        requestInfo = new NicksRequestInfo();
        
        NickInfo nick = new NickInfo();
        nick.FriendID = 1;
        nick.FriendName = "Me";
        nick.ID = DateTime.Now.Ticks;
        nick.NickName = "a nickname";
        nick.NickOwnerID = 2;
        nick.PhotoUrl = "http://somepicture.jpg";
        nick.ProfileURL = "http://hi5.com/friend/11222";

        NickInfo nick3 = new NickInfo();
        nick3.FriendID = 1;
        nick3.FriendName = "A user";
        nick3.ID = DateTime.Now.Ticks;
        nick3.NickName = "just funny";
        nick3.NickOwnerID = 2;
        nick3.PhotoUrl = "http://apicture.jpg";
        nick3.ProfileURL = "http://hi5.com/friend/112252";

        requestInfo.GivenNicks.Add(nick);
        requestInfo.GivenNicks.Add(nick3);

        NickInfo nick2 = new NickInfo();
        nick2.FriendID = 3;
        nick2.FriendName = "You";
        nick2.ID = DateTime.Now.Ticks;
        nick2.NickName = "other nickname";
        nick2.NickOwnerID = 2;
        nick2.PhotoUrl = "http://somepicture2.jpg";
        nick2.ProfileURL = "http://hi5.com/friend/4422";

        requestInfo.ReveivedNicks.Add(nick2);

        string xmlResponse = NicksLogic.XmlBuilder.GetRequestAsXml(requestInfo);

        //

        Response.ClearHeaders();
        Response.ClearContent();
        Response.ContentType = "text/xml";
        Response.Write(xmlResponse);
        Response.Flush();
        Response.Close();
    }
}
